package com.bx.im.ai.chat;

import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.stereotype.Component;

/**
 * @date 2025/1/16
 */
@Slf4j
@Component
public class SpringAiChatClient implements AiChatClient {
    
    private final ChatClient chatClient;
    
    public SpringAiChatClient(ChatClient.Builder builder) {
        this.chatClient = builder.build();
    }
    
    @Override
    public String text(String content) {
        return chatClient.prompt().user(content).call().content();
    }
}
